package com.shopping.mall.core.module.goods.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotNull;
import java.sql.Timestamp;

/**
* GoodsLan实体类
*
* @author zzy
* @date 2021-08-13
*/
@Data
@TableName("goods_lan")
public class GoodsLan {

    public interface insert{
    }

    public interface update{
    }

    @ApiModelProperty(value="主键")
    @TableId(type = IdType.UUID)
    private String goodsId;

    @ApiModelProperty(value="一级类型")
    private String primaryTypeId;

    @ApiModelProperty(value="二级类型")
    private String secondaryTypeId;

    @ApiModelProperty(value="三级类型")
    private String tertiaryTypeId;

    @ApiModelProperty(value="商品名")
    private String name;

    @ApiModelProperty(value="超简介")
    private String lessIntro;

    @ApiModelProperty(value="简介")
    private String intro;

    @ApiModelProperty(value="详情")
    private String details;

    @ApiModelProperty(value="生产商")
    private String producer;

    @ApiModelProperty(value="主图片")
    @NotNull(message="main_image不能为空",groups={Goods.insert.class})
    private String mainImage;

    @ApiModelProperty(value="轮播图")
    private String subImages;

    @ApiModelProperty(value="规格列表(存为json)")
    private String attributeList;

    @ApiModelProperty(value="原价(所有规格最低价,用于显示商品列表中价格)")
    private Double price;

    @ApiModelProperty(value="现价(所有规格最低价,用于显示折扣价格)")
    @TableField(updateStrategy = FieldStrategy.IGNORED)//更新时可以更新为空
    private Double currentPrice;

    @ApiModelProperty(value="库存数量")
    private Integer stock;

    @ApiModelProperty(value="售卖状态(1正常售卖,0停止售卖)")
    private Integer status;

    @ApiModelProperty(value="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp createAt;

    @ApiModelProperty(value="修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp updateAt;

    @ApiModelProperty(value="语言id")
    private String languageId;


}
